@extends('layouts.student')

@section('content')

<style type="text/css">
.delegate{margin:10px;}
</style>
<div class="page-content">
	<div class="page-header">
		<h1>论文选题</h1>
	</div>
	<div class="row">
	<div class="col-xs-12">
			<div class="row">
				<!-- PAGE CONTENT BEGINS -->
				<form id="title-form" name="twowayform" class="form-horizontal" method="POST" action="/student/thesis/edittitle">
					{{ csrf_field() }}
					<label class="col-xs-12 col-sm-2 control-label no-padding-right alert alert-block alert-success"> 更新选题 </label>
					<div class="form-actions col-xs-12 col-sm-6" style="margin-top:0px; margin-left:5px;background:#f5f5f5">
						<div class="input-group">
						<input placeholder="输入选题" type="text" class="form-control" name="title" value="{{$current? $current->title : ''}}" />
                                      <span class="input-group-btn">
						<button  class="btn btn-info btn-sm" type="button" onclick="event.preventDefault(); document.getElementById('title-form').submit();">
							<i class="icon-ok bigger-110"></i>
							更新
						</button>
					</span>
						</div>
					</div>
				</form>
			</div>
			<div class="row">
				<div class="col-xs-12">
					@if (count($errors) > 0)
					<div class="space-4"></div>
					<div class="alert alert-danger">
						<ul>
							@foreach ($errors->all() as $error)
							<li>{{ $error }}</li>
							@endforeach
						</ul>
					</div>
					@endif

					@if ($edit == true)
					<div class="space-4"></div>
					<div class="alert alert-danger">
						修改成功
					</div>
					@endif					
					
				</div>
			</div>
			<div class="hr hr16 hr-dotted" ></div>
			<div class="row form-horizontal">
				<label class="col-xs-12 col-sm-2 control-label no-padding-right alert alert-block alert-success"> 历史版本</label>
				<div class="col-xs-12 col-sm-6" style="margin-top:0px; margin-left:5px;background:#f5f5f5">
					<div id="profile-feed-1" class="profile-feed" style="overflow: hidden; height: 100px;">
						@foreach($history as $item)
						<div class="profile-activity clearfix">
							<div>
								
								<a class="user" href="#">{{$item->title}}</a>
								<div class="time">
									<i class="icon-time bigger-110" style="margin-right:5px;"></i>提交时间:{{$item->created_at}}
								</div>
							</div>
						</div>
						@endforeach
					</div>
				</div>
			</div>

			<div class="hr hr16 hr-dotted"></div>
			<div class="row form-horizontal">
				<label class="col-xs-12 col-sm-2 control-label no-padding-right alert alert-block alert-success"> 和导师讨论修改意见 </label>
				<div class="col-xs-12 col-sm-6" style="margin-top:0px; margin-left:5px;background:#f5f5f5">
					@include('comment', $commentInfo)
				</div>		
			</div>
			<div class="hr hr16 hr-dotted"></div>
			<div class="row form-horizontal">
					<label class="alert alert-block alert-success col-xs-12 col-sm-2 control-label no-padding-right"> 导师最终意见 </label>
					<div class="col-xs-12 col-sm-6 no-padding-left;" style="margin-top:0px; margin-left:5px;background:#f5f5f5">
						@if($thesis->approved)
						<span class="label label-success arrowed-in arrowed-in-right" style="font-size:16px; height:24px;">审批通过</span>
						@else
						<span class="label label-warning" style="font-size:16px; height:24px;">等待审批</span>
						@endif
					</div>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
	@if($history->count() > 0)
	$('#profile-feed-1').slimScroll({
		height: '150px',
		alwaysVisible : true
	});
	@endif
</script>
@endsection



